﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Drawing;
using System.Data;
using System.Linq;
using System.Text;
using System.Windows.Forms;
using SmartEP.Presenter;

namespace SmartDesktop
{
    public partial class Step7View : MedicalHistoryBaseView, IStep7View
    {
        public Step7View(PatientCarePresenter presenter)
            : base(presenter)
        {
            InitializeComponent();
            this.Name = "Registration Step 7";
            MainForm.BarCaption.Text = this.Name;

            this.step = 7;
            this.GroupStep = GroupStepType.MedicalHistory;
        }     

        #region Property
        public bool IsDrive
        {
            get
            {
                return rdYesDrive.Checked;
            }
            set
            {
                rdYesDrive.Checked = value;
            }
        }

        public bool HaveVisualDifficultyWhenDriving
        {
            get
            {
                return rdYesVisualDifficulty.Checked;
            }
            set
            {
                rdYesVisualDifficulty.Checked = value;
            }
        }

        private int _exposedorinfected;
        public int ExposedOrInfected
        {
            get
            {
                return _exposedorinfected;
            }
            set
            {
                if (rdGonorrhea.Checked)
                {
                    _exposedorinfected = 1;
                }
                else if(rdHiv.Checked)
                {
                    _exposedorinfected = 2;
                }
                else if(rdSyphilis.Checked)
                {
                    _exposedorinfected = 3;
                }
                else if(rdHepatitits.Checked)
                {
                    _exposedorinfected = 4;
                }
            }
        }

        public string DrinkAlcohol
        {
            get
            {
                return txtAlcohol.Text;
            }
            set
            {
                txtAlcohol.Text = value;
            }
        }

        public string UseTobacco
        {
            get
            {
                return txtTobacco.Text;
            }
            set
            {
                txtTobacco.Text = value;
            }
        }

        public string UseIllegalDrugs
        {
            get
            {
                return txtDrugs.Text;
            }
            set
            {
                txtDrugs.Text = value;
            }
        }
        #endregion

        private void btnContinue_Click(object sender, EventArgs e)
        {
            this.presenter.DisplayNextStep(this.step);
        }

        private void btnBack_Click(object sender, EventArgs e)
        {
            this.presenter.BackToPreviousStep(this.step);
        }

    }
}
